package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BasePageData;
import com.cskaoyan.bean.BaseParam;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.User;
import com.cskaoyan.service.UserService;
import com.cskaoyan.utils.ShiroGetSubjectMessageUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author tangjian
 * @Date 2021/10/21 15:54
 * @description
 */
@RestController
@RequestMapping("/wx/footprint")
public class WxFootprintController {

    @Autowired
    UserService userService;

    @RequestMapping("list")
    public BaseRespVo wxFootprintLis(BaseParam baseParam) {

        Integer userId =
                ShiroGetSubjectMessageUtil.getUserID();

        BasePageData basePageData = userService.listFootprint(userId, baseParam);

        return BaseRespVo.ok(basePageData);
    }

    @RequestMapping("delete")
    public BaseRespVo wxFootprintDelete(Integer id) {
        int i = userService.footprintDelete(id);
        return BaseRespVo.ok();
    }
}
